//
//  MessageViewController.m
//  CNKICommunity
//
//  Created by wei on 17/1/23.
//  Copyright © 2017年 CNKI. All rights reserved.
//

#import "MessageViewController.h"
#import "CNKIMainView.h"
#import "NoticationViewController.h"
@interface MessageViewController ()

@property(nonatomic,strong)CNKIMainView *MessageHorizonScorllview;

@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    //取消自动排距 重要
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    [self setUpChildController];
    
    [self setUpHeadScrollview];
    
    
    
}
-(void)setUpHeadScrollview
{
    _MessageHorizonScorllview = [[CNKIMainView alloc]initWithFrame:CGRectMake(0, 64, SCREENWIDTH, SCREENHEIGHT - 64)];
    _MessageHorizonScorllview.viewControllers = [NSMutableArray arrayWithArray:self.childViewControllers];
    _MessageHorizonScorllview.btnSelectColor = [UIColor blueColor];
    _MessageHorizonScorllview.btnNormalColor = [UIColor blackColor];
    [self.view addSubview:_MessageHorizonScorllview];
    
}
-(void)setUpChildController
{
    NSArray *titles = @[@"今天",@"是个",@"好日子",@"心想的",@"事儿",@"都能成",@"明天",@"是个",@"好日子",@"打开了家门",@"咱迎春风",@"~~~"];
    for (int i = 0; i < titles.count; i++)
    {
        NoticationViewController *VC = [[NoticationViewController alloc]init];
        VC.title = titles[i];
        [self addChildViewController:VC];
    }
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   
}


@end
